/*
Author: Ryan Westfall
Class Name: Facilities
Functionality: This class will create the facility object that will be inherited be the
Subway, Airport, Arena, Police Station, Hospital
Version number: 0.0.1
Testers: needs to be tested
Date written: October 24, 2011
Date tested: needs to be tested
To-do:
*/

package disease;

import disease.GameMap;

public class Facilities {
    protected boolean on;
    @SuppressWarnings("unused")
	private String facilityType;//<-- this will tell which type of building it is
    private int upGradeCost;
    //protected boolean upgradeable;
   
    public Facilities(String type)
    {
        on = true;
        if(GameMap.getDifficulty() == 1){
        	//easy
        	upGradeCost = 1000;
        }else if(GameMap.getDifficulty() == 2){
        	//medium
        	upGradeCost = 2000;
        }else if(GameMap.getDifficulty() == 3){
        	//hard
        	upGradeCost = 4000;
        }else{
        	//should not be here
        	System.out.println("Difficulty should be set to 1 2 or 3");
        }
        //upgradeable = true;
        if((type == "Airport")||(type == "Arena")||(type == "Subway")||(type == "Police Station")||(type == "Hospital"))
        {//will make sure that the spelling of the type is correct
            facilityType = type;
        }
    }
    public void closeBuilding(){
        //turns the building off
        if(on == true){
            on = false;
            //upgradeable = false;
        }else if(on == false){
            System.out.println("the building is already off");
            //<---  this should be logged
        }
    }
    public void openBuilding(){
        //turns the building on
        if(on == false){
            on = true;
            //upgradeable = true;
        }else if(on == true){
            System.out.println("the building is already on");
            //<-- this should also be logged
        }
    }
    
    
    public void upgradeBuilding(){
    	upGradeCost += upGradeCost;
    }
    
    public boolean isBuildingOpenOrClosed(){
    	return on;
    }
    
    public int getUpgradeCost(){
    	return upGradeCost;
    }
}